home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8977 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  856 b 

  1. Path: koobera.math.uic.edu!djb
  2. From: djb@koobera.math.uic.edu (D. J. Bernstein)
  3. Message-ID: <1996Feb2718.30.22.8951@koobera.math.uic.edu>
  4. Date: 27 Feb 1996 18:30:22 GMT
  5. Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
  6. Subject: Re: Access carry flag from C
  7. References: <Dn1C9z.DGv.0.net@indra.com> <4gihtk$33k@sun001.spd.dsccc.com> <1996Feb2300.56.01.15905@koobera.math.uic.edu> <3132f48b.33181161@netline-fddi.jpl.nasa.gov>
  8. Organization: IR
  9.  
  10. Kevin Quitt <kdq@emoryi.jpl.nasa.gov> wrote:
  11. > djb@koobera.math.uic.edu (D. J. Bernstein) wrote:
  12. > > The correctness of ``if (i < j)'' as an overflow test is guaranteed by
  13. > > the ANSI C definition of unsigned arithmetic, which happens to match
  14. > > what every existing compiler does.
  15. > Given that the overflow causes undefined behaviour,
  16.  
  17. It doesn't. Unsigned overflow is perfectly well defined.
  18.  
  19. ---Dan
  20.